<?php
if (isset($_GET['value'])) {
  $genid = (int)$_GET['value'];
};

  $dbconn = new mysqli("202.116.162.2", "xfwang", "13622244006", "xfwang", "3306");
  $sqlStat =  sprintf('SELECT gen_no, gen_nm_la FROM cat_gen WHERE fam_no = %d;', $genid);
  if ($sqlQuery = $dbconn->query($sqlStat)){
    while($sqlResult = $sqlQuery->fetch_assoc()){
      $output = sprintf('<option value = "%d">%s</option>', $sqlResult['gen_no'], $sqlResult['gen_nm_la']);
      echo $output;
    }
  }
  $dbconn->close;

?>
